﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using WindowsLive.Writer.Api;

namespace Badder.LiveWriterPlugins.HiLi
{
    [InsertableContentSource("Code HiLi"),
    WriterPlugin("6106166f-a5ca-4838-82d2-1b7d9a808d70", "Code Highlighter", ImagePath = "hili32.bmp", PublisherUrl = "http://www.badder.cn", Description = "WordPress Code Highlighter for Live Writer", HasEditableOptions = true)]
    public class HiLiPlugin : ContentSource
    {
        // Methods
        public override DialogResult CreateContent(IWin32Window dialogOwner, ref string newContent)
        {
            HiLiEditForm editor = new HiLiEditForm();
            if (editor.ShowDialog(dialogOwner) == DialogResult.OK)
            {
                newContent = editor.FormattedCode;
                return DialogResult.OK;
            }
            return DialogResult.Cancel;
        }
    }
}
